package demo2;

import java.io.*;

public class DEMO_01 {
    public static void main(String[] args) throws IOException {
        //文件不存在会抛出异常
//       InputStream inputStream=new FileInputStream(new File("D:/temp/text1.txt"));
//        System.out.println(inputStream.read());
        InputStream inputStream = new FileInputStream(new File("D:/temp/text2.txt"));
        while (true){
            int read = inputStream.read();
            if(read==-1) break;
            System.out.println(read);
        }
        inputStream.close();

    }
}
